package scene.road
{
	import flash.display.DisplayObject;
	import flash.display.Sprite;

	public class RoadController
	{
		private var _map:Sprite;
		
		private var _vecRoad:Vector.<Array>;
		
		public function RoadController( map:Sprite )
		{
			_map = map;
			init();
		}
		
		private function init():void
		{
			_vecRoad = new Vector.<Array>();
			var arr:Array = new Array();
			var i:int = 0;
			while( true )
			{
				var dis:DisplayObject = _map.getChildByName("r"+i);
				i++;
				if( dis==null ) break;
				_map.removeChild( dis );
				arr.push( [dis.x, dis.y] );
			}
			_vecRoad.push( arr );
		}
		
		public function getRoadPathByIndex( index:int ):Array
		{
			return _vecRoad[0];
		}
	}
}